package close.kenny.shell
{
	import close.kenny.shell.controller.LoginCommand;
	import close.kenny.shell.controller.StartupCommand;
	import close.kenny.shell.controller.UserIniCommand;
	import org.puremvc.as3.multicore.interfaces.IFacade;
	import org.puremvc.as3.multicore.patterns.facade.Facade;

	public class ShellFacade extends Facade implements IFacade
	{
		public static const STARTUP:String="startup";
		
		public static const LOGIN:String="login";

		public static const LOGINSUCCESS:String="loginsuccess";
//		
		public static const LOGINFAULT:String="loginfault";
		/**  
		 * 此消息用来通知windowcontainer增加一个窗口	
		 **/
		public static const ADDWINDOW:String="addwindow";
		
		public static const ADDWINDOWLEFT:String="addwindowleft";
		
		public static const ADDWINDOWRIGHT:String="addwindowright";
		
		public static const USERINI:String="userini";
		
		public static const SHORTCUTINI:String="shortcutini";
		
		public static const APPMENUINI:String="appmenuini";
//		public static const ADDWINDOW:String="addwindow";
//
//		public static const DESKTOPBUTTONGROUPINI:String="desktopbuttongroupini";
//
//		public static const STARTMENUINI:String="startmenuini";


		public function ShellFacade(key:String)
		{
			super(key);
		}

		public static function getInstance(key:String):ShellFacade
		{
			if (instanceMap[key] == null)
				instanceMap[key]=new ShellFacade(key);
			return instanceMap[key] as ShellFacade;
		}

		override protected function initializeController():void
		{
			super.initializeController();
			registerCommand(LOGIN, LoginCommand);
			registerCommand(STARTUP, StartupCommand);
			registerCommand(USERINI, UserIniCommand);
		}

		public function startup(app:Shell):void
		{
			sendNotification(STARTUP, app);
		}
	}
}